﻿<controls:ChildWindow x:Class="BuildARoute.Views.EditStopWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="456" Height="374" 
           Title="EditStopWindow" Style="{StaticResource LogRegWindowStyle}"
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           mc:Ignorable="d"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
           xmlns:my="clr-namespace:BuildARoute.Web.Services"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:my1="clr-namespace:BuildARoute.Web.Models">
    
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <toolkit:DataForm Name="stopDataForm" AutoEdit="True" Style="{StaticResource DataFormStyle}" CommandButtonsVisibility="None" CurrentItem="{Binding}" Grid.Row="0">
            <toolkit:DataForm.EditTemplate>
                <DataTemplate>
                    <StackPanel>
                        <toolkit:DataField Label="Stop Title">
                            <TextBox Text="{Binding Title,Mode=TwoWay}"/>
                        </toolkit:DataField>
                        <toolkit:DataField Label="Language">
                            <ComboBox ItemsSource="{Binding ElementName=languageDomainDataSource, Path=Data}" SelectedItem="{Binding Language}"/>
                        </toolkit:DataField>
                        
                    </StackPanel>
                </DataTemplate>
            </toolkit:DataForm.EditTemplate>
        </toolkit:DataForm>
        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="29" HorizontalAlignment="Right" Margin="0,6,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="28" HorizontalAlignment="Right" Margin="0,7,79,0" Grid.Row="1" />
        <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my1:Language, CreateList=true}" Height="0" LoadedData="languageDomainDataSource_LoadedData" Name="languageDomainDataSource" QueryName="GetLanguagesQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <my:TourGuideDomainContext />
            </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
        <Button Content="Add a POI" Grid.Row="1" Height="27" HorizontalAlignment="Left" Margin="16,6,0,0" Name="addPOIButton" Click="addPOIButton_Click" VerticalAlignment="Top" Width="107" />
    </Grid>
</controls:ChildWindow>